//
//  GYRecriveAddress.m
//  GoodLuck
//
//  Created by 郭为勇 on 2018/3/17.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//

#import "GYRecriveAddress.h"

@implementation GYRecriveAddress

+ (NSMutableArray *)loadUserRecriveAddress:(NSArray *)source {
    NSMutableArray *models = [NSMutableArray array];
    for (NSDictionary *dic in source) {
        GYRecriveAddress *address = [[GYRecriveAddress alloc] initWithDic:dic];
        address.selectedState = NO;
        [models addObject:address];
    }
    return models;
}

- (instancetype)initWithDic:(NSDictionary *)dic {
    if ([super init]) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return  self;
}

- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    
//    if ([key isEqualToString:@"is_default"]) {
//        if ([value intValue] == 1) {
//            self.selectedState = YES;
//        }else {
//            self.selectedState = NO;
//        }
//        
//        return;
//    }
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}
@end
